Add AirflowNetwork opening scheduling#11015
Conversation
|
May need to go back in here and adjust the schedule further to get closer to the original result, this is changing the results quite a bit. Maybe a Schedule:File that mimics the original behavior?
|
| int RAFNNodeNum; // Index of RAFN node number | ||
|
|
||
| // Default Constructor | ||
| MultizoneZoneProp() |
There was a problem hiding this comment.
I thought we're not doing constructors this way anymore and we're putting the default values into the declarations. That's much cleaner IMO. Same comment on constructors below.
| { | ||
| // Members | ||
| std::string ZoneName; // Name of Associated EnergyPlus Thermal Zone | ||
| std::string VentControl; // Ventilation Control Mode: "TEMPERATURE", "ENTHALPIC", "CONSTANT", or "NOVENT" |
| // and moisture levels at each node, and airflow and sensible and latent energy losses | ||
| // at each element | ||
|
|
||
| static Real64 square(Real64 x) |
There was a problem hiding this comment.
Why add the function call overhead? Will this inline if you add the inline keyword?
|
|
||
| namespace AirflowNetwork { | ||
|
|
||
| void handle_nonrectangular_surfaces(EquivRec equivalent_rectangle_method, EPVector<DataSurfaces::SurfaceData> Surface, const std::string &surface_name, int surface_number, |
There was a problem hiding this comment.
Passing EPVector by value? Not const &?
| void handle_nonrectangular_surfaces(EquivRec equivalent_rectangle_method, EPVector<DataSurfaces::SurfaceData> Surface, const std::string &surface_name, int surface_number, | ||
| Real64 &height, Real64 &width, Real64 user_aspect_ratio, EnergyPlusData *state) | ||
| { | ||
| if (equivalent_rectangle_method == EquivRec::Height) { |
There was a problem hiding this comment.
auto &surf = Surface(surface_number); shortcut would make this code more readable.
| auto const equiv_rect_iter{fields.find("equivalent_rectangle_method")}; | ||
| EquivRec equivrec{EquivRec::Height}; | ||
| if (equiv_rect_iter != fields.end()) { | ||
| // This is guaranteed to work since inputs are validated |
| "\" is an air boundary surface."); | ||
| ShowContinueError(m_state, "Ventilation Control Mode = " + Alphas(4) + " is not valid. Resetting to Constant."); | ||
| MultizoneSurfaceData(i).VentSurfCtrNum = VentControlType::Const; | ||
| ShowContinueError(m_state, "Ventilation Control Mode = " + std::map<VentControlType, std::string> {{VentControlType::Temp, "TEMPERATURE"}, |
There was a problem hiding this comment.
Once more. Creating a single-use map and then searching it is slower than just doing the if-else string comparison ladder that was there before.
| @@ -5170,6 +4954,20 @@ namespace AirflowNetwork { | |||
| } | |||
| } | |||
|
|
|||
| // Final linkage validation | |||
| for (auto& linkage : AirflowNetworkLinkageData) | |||
There was a problem hiding this comment.
This can be auto const &.
| int LF; | ||
| int LT; | ||
| int CompNum; | ||
| int NF; | ||
| int NT; | ||
| iComponentTypeNum CompTypeNum; | ||
| AirflowElementType CompTypeNum; |
There was a problem hiding this comment.
Why remove num from the type name but not the variable name?
|
|
||
| // The original test was changing the CompTypeNum, as that goes away it's necessaey to actually | ||
| // switch out the elements. This is probably an unwise approach. | ||
| auto const ye_olde_element = state->afn->AirflowNetworkLinkageData(2).element; |
There was a problem hiding this comment.
Since element is a pointer, please declare this as auto const *.
|
@jasondegraw @Myoldmopar it has been 30 days since this pull request was last updated. |
|
@jasondegraw @Myoldmopar it has been 31 days since this pull request was last updated. |
|
@jasondegraw @Myoldmopar it has been 29 days since this pull request was last updated. |
|
@jasondegraw @Myoldmopar it has been 30 days since this pull request was last updated. |
|
@jasondegraw @Myoldmopar it has been 28 days since this pull request was last updated. |
|
@jasondegraw @Myoldmopar it has been 30 days since this pull request was last updated. |
|
@jasondegraw @Myoldmopar it has been 28 days since this pull request was last updated. |
2 similar comments
|
@jasondegraw @Myoldmopar it has been 28 days since this pull request was last updated. |
|
@jasondegraw @Myoldmopar it has been 28 days since this pull request was last updated. |
|
@jasondegraw @Myoldmopar it has been 30 days since this pull request was last updated. |
Pull request overview
This PR builds on previous work done related to linkage scheduling and adds the ability to schedule openings when using the AirflowNetwork feature.
Pull Request Author
Reviewer